<script type="text/javascript">
//页面加载时执行
$(function(){
	array=[];//清空数组
	$.get("applicationSingle/getCardInfo",function(data){
		var contentb="<option value='' selected>请选择</option>";
		var contentc="<option value='' selected>请选择</option>";
		var i;
		$(data).each(function(n,item){
			for(i=0;i<item.cdProDefinitions.length;i++){
				if(item.cdProDefinitions[i].cardTypeCode=="2"){
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					+item.cdProDefinitions[i].cardpName+"</option>"	
				}
			}
			for(i=0;i<item.certificates.length;i++){	
				contentc+="<option value="+item.certificates[i].certificateType+">"
				+item.certificates[i].certificatesName+"</option>"
			}
			$("#PaperTypeByGetBatch").html(contentc);
			$("#cardCodeByGetBatch").html(contentb);
		});
	},"json");
	
	$.post("issueCardBatch/getCardBatchInfo",getCardBatchInfo,"json");
	
});
function printInfo(){
	var res=validateChechBox10();
	if(res==false){
		return false;
	}
	var applyBatchNo=""
	var workCorp=""
	var array;
	$("input[name='getCardBatch']:checked").each(function(n,item){
		array=$(this).val().split("#")
		//alert(array);
		applyBatchNo=array[0];
		workCorp=array[4];
	})
	
	
        var url = "issueCardBatch/download";
        var form = $("<form></form>").attr("action", url).attr("method", "post");
        form.append($("<input></input>").attr("type", "hidden").attr("name", "applyBatchNo").attr("value", applyBatchNo));
        form.append($("<input></input>").attr("type", "hidden").attr("name", "workCorp").attr("value", workCorp));

        form.appendTo('body').submit().remove();
	
	}
</script>
<div class="pageHeader ">
	<form id="pagerForm" method="post"
		action="issueCardBatch/getCardBatchInfo"
		class="pageForm required-validate"
		onsubmit="return validateCallback(this,getCardBatchInfo);">
		<input type="hidden" name="pageNum" value="" /> 
		<input type="hidden" name="numPerPage" value="" />
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>卡产品：</label><select id="cardCodeByGetBatch"
							name="cardPCode"></select>
					</p>
				</div>
				<div class="col-md-6 col-sm-12">
					<p>
						<label>申请批次号：</label><input name="applyBatchNo" class="validApplyNo"
							type="text" size="26" />
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>申领日期(起)：</label><input name="startDate" class="date validDateFrom"
							type="text" size="26" />
					</p>
				</div>
				<div class="col-md-6 col-sm-12">
					<p>
						<label>申领日期(止)：</label><input name="endDate" class="date validDateTo"
							type="text" size="26" />
					</p>
				</div>
			</div>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit" onclick="initCurrentPage()">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>

<form method="post" action="issueCardBatch/commitBatch"
	class="pageForm required-validate"
	onsubmit="return validateCallback(this,printViewPageAjaxDone);">
	<div class="pageContent">
		<div id="ByGetCardBatch">
			<table class="table" width="100%" layoutH="298">
				<thead>
					<tr align="center">
						<!-- <th width="2%"><input type="checkbox"
							onclick="checkAllCss(this)" name="" group="getCardBatch"
							class="checkboxCtrl"></th> -->
						<th width="3%">选择</th>
						<th width="23%">申请批次号</th>
						<th width="15%">申请网点</th>
						<th width="15%">卡产品</th>
						<th width="10%">数量</th>
						<th width="15%">申领日期(预计)</th>
						<th width="19%">工作单位</th>
					</tr>
				</thead>
				<tbody id="getCardBatch">

				</tbody>
			</table>
		</div>
		<!--  <div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="numPerPageByGetCardBatch" name="numPerPage" onchange="paging(this,$('#getCardBatchInfo'),getCardBatchInfo)">
				<option value="20">20</option>
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span id="totalCountByGetCardBatch" ></span>
		</div>
		
			<div id="paginationByGetCardBatch" class="pagination1"  ></div>
	</div> -->
		<div class="panelBar">
			<div class="pages">
				<span>显示</span> <select class="combox" name="numPerPage"
					onchange="navTabPageBreak({numPerPage:this.value},'getCardBatch',getCardBatchInfo)">
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
				</select> <span id="totalCountByGetCardBatch">条，共${totalCount}条</span>
			</div>

			<div callback='getCardBatchInfo' id="paginationByGetCardBatch"
				rel="getCardBatch" class="pagination" targetType="navTab"
				totalCount="200" numPerPage="5" pageNumShown="5" currentPage="1"></div>

		</div>
		<div class="pageFormContent" layoutH="250">
			<p>
				<label>代理人证件类型：</label> <select flag="paperCode" id="PaperTypeByGetBatch"
					name="agentPaperType">

				</select>
			</p>
			<p>
				<label>代理人证件号码：</label> <input type="text" size="30"
					name="agentPaperNo" class="validIdentity" />
			</p>
			<p>
				<label>代理人姓名：</label> <input type="text" size="30" name="agentName" class="validName"/>
			</p>
			<p>
				<label>代理人手机号码：</label> <input type="text" size="30"
					name="agentPhone" class="validMobile" />
			</p>
			<div class="formBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button id="subTask" onclick="return validateChechBox10();"
									type="submit" class="valid">发卡</button>
							</div>
						</div>
					</li>
					<li><!-- <a class="buttonActive" 
						onclick="return printInfo();" ><span>打印</span></a> -->
						<div class="buttonActive">
							<div class="buttonContent">
								<button id="subTask" onclick="return printInfo();"
									type="submit" class="valid">打印</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</form>


